import { useNavigate, useParams} from 'react-router-dom'
function My() {
  let nav = useNavigate()
  let {id} = useParams()
  const goHome = () => {
    nav('/', {
      state:  {
        ids: '回去的参数'
      }
    })
  }
  return (
    <div>
      <span>My</span>
      <div>参数 {id}</div>
      <button onClick={goHome}>返回</button>
    </div>
  )
}
export default My 